package com.shop.user.conf;

import com.shop.common.util.RedisUtil;
import com.shop.common.util.SessionUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BaseConfig {
    @Bean
    public RedisUtil redisUtil() {
        RedisUtil redisUtil = new RedisUtil();
        redisUtil.init("127.0.0.1", 6379);
        return redisUtil;
    }

    @Bean
    public SessionUtils sessionUtils() {
        SessionUtils sessionUtils = new SessionUtils();
        sessionUtils.setRedisUtil(redisUtil());
        return sessionUtils;
    }


}
